package com.vend.shop.view
import android.os.Bundle
import com.alibaba.android.arouter.facade.annotation.Route
import com.vend.common.base.BaseActivity
import com.vend.common.constant.CustomConstant
import com.vend.common.constant.RouterConstant
import com.vend.common.mvp.IPresenter
import com.vend.shop.R
/**
 * Created by glendal on 2022/01/26.
 * 货物列表调试的展示界面
 */
@Route(path = RouterConstant.SHOP_LIST_ACTIVITY_TEST)
class ShopListActivity : BaseActivity<IPresenter>() {
    override fun getContentLayoutId(): Int {
        return R.layout.activity_shop_list
    }

    override fun initView(savedInstanceState: Bundle?) {
        addFragment()
    }
    private fun addFragment(){
        //这里是将网页加载数据出来方便调试逻辑处理
        val fragment = ShopListFragment()
        val bundle = Bundle().also {
            it.putBoolean(CustomConstant.IS_VIEW_PAGE,false)
        }
        fragment.arguments = bundle;//数据传递到fragment中
        val begin = supportFragmentManager.beginTransaction()
        begin.replace(R.id.contains_shop,fragment)
        begin.commit()
    }
}